#ifndef __ENTITY__
#define __ENTITY__

#include "animated_sprite.h"

extern BITMAP * entArr[ENTITY_LIBRARY_SIZE][ENTITY_ANIMATION_SIZE];

/*! \brief Entity class.
*
* Entities are things such as Bullets, Effects
*/
class Entity : public AnimatedSprite {
  public:
    /*! \brief Class constructor.
    *
    */
    Entity();
    /*! \brief Update the entity.
    *
    * Update things such as Animation, Movement, and so on.
    */
    virtual int __update() = 0;
    /*! \brief Library Initializer.
    *
    * Must be used first.\ It loads every bitmap needed.
    */
    static void entLibInit();
    /*! \brief Library destructor.
    *
    * Free the memory.
    */    
    static void entLibDestroy();
    /*! \brief Returns the type of entity.
    *
    * \return integer
    */
    int __getType();

  protected:
    /**
    * integer.
    * Lifespan of the entity.
    */
    int _life;
    /**
    * integer.
    * Type of entity.
    */    
    int _type;    
};

/*! \brief Entity bullet class.
*
*/
class eShot : public Entity {
  public:
    /*! \brief Class constructor.
    *
    * \param speedx is the horizontal speed
    * \param speedy is the vertical speed
    * \param life is the lifespan of the bullet
    * \param damage is the amount of damage dealt by the bullet
    * \param spriteType is the animated sprite to display
    */
    eShot(int speedx = 2, int speedy = 0, int life = 60, int damage = 1, int spriteType = 0);
    int __update();
    /*! \brief Get the amount of damage dealt by the bullet.
    *
    */
    int __getDamage();
    /*! \brief Set the owner of the bullet.
    *
    * (see consts.h).
    */
    void __setOwner(int nOwner);
    /*! \brief Get the owner of the bullet.
    *
    * (see consts.h).
    */
    int __getOwner();

  private:
    int _shotSpeedX;
    int _shotSpeedY;
    int _shotLife;
    int _shotDamage;
    int _owner;
};

/*! \brief eHit Entity HitBox class.
*
*/
class eHit : public Entity {
  public:
    /*! \brief Class constructor.
    *
    * \param nbb is the BoundingBox to generate
    * \param damage integer
    * \param lifespan length of the entity (in frames)
    */
    eHit(BoundingBox nbb, int damage, int lifespan);
    int __update();
    /*! \brief Returns the damage dealt by the hit.
    *
    * \return integer
    */
    int __getDamage();
  private:
    int _hitDamage;
  
};
/*
class eEffect : public Entity {
  public:
    eEffect(int x, int y, int latency = 0);
    int __update();

  private:
    int _latency;
};
*/
#endif
